package com.micro.ai.files.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 文件版本实体类
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@TableName("file_versions")
@Schema(description = "文件版本信息")
public class FileVersion implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "版本ID", example = "version_123456789")
    private String id;

    /**
     * 文件ID
     */
    @Schema(description = "文件ID", example = "file_123")
    private String fileId;

    /**
     * 版本号
     */
    @Schema(description = "版本号", example = "1")
    private Integer versionNumber;

    /**
     * 文件路径
     */
    @Schema(description = "文件路径", example = "versions/file_123_v1.jpg")
    private String filePath;

    /**
     * 文件大小（字节）
     */
    @Schema(description = "文件大小（字节）", example = "1048576")
    private Long fileSize;

    /**
     * 文件哈希
     */
    @Schema(description = "文件哈希", example = "abc123...")
    private String fileHash;

    /**
     * MIME类型
     */
    @Schema(description = "MIME类型", example = "image/jpeg")
    private String mimeType;

    /**
     * 版本变更描述
     */
    @Schema(description = "版本变更描述", example = "修复了图片质量问题")
    private String changeDescription;

    /**
     * 创建人ID
     */
    @Schema(description = "创建人ID", example = "user_001")
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间", example = "2025-01-01 00:00:00")
    private LocalDateTime createdAt;
}

